import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import ajax from "./api/http";
import api from "./api/apiConfig";
import commonJs from "@/tool/common";
import $crypto from "@/tool/crypto";
import "normalize.css";
import "@/style/reset.css";
import "@/assets/fonticon/iconfont.css";
import { Toast } from "mand-mobile";
import inputValidate from "@/components/input-validate/index";
import VeeValidate, { Validator } from "vee-validate";
import zh_CN from "vee-validate/dist/locale/zh_CN";
import VueI18n from "vue-i18n";
Vue.use(VueI18n);
const i18n = new VueI18n({
  locale: "zh_CN"
});
const dict = {
  zh_CN: {
    messages: {
      required: name => `请输入${name}`,
      is: () => "两次输入的密码不一致"
    }
  } // name接受alias的值.
};
Vue.use(VeeValidate, {
  i18n,
  i18nRootKey: "validation",
  dictionary: {
    zh_CN
  }
});
Validator.localize(dict);
Vue.prototype.$crypto = $crypto;
Vue.prototype.$ajax = ajax;
Vue.prototype.$api = api;
Vue.prototype.$commonJs = commonJs;
Vue.config.productionTip = false;
Vue.prototype.$toast = Toast;
Vue.component("inputValidate", inputValidate);
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");
